
import time
from ArmIK.ArmMoveIK import *
import Board

if __name__ == "__main__":
    AK = ArmIK()
    # setBusServoPulse(6, 500, 1500)
    # time.sleep(1)
    # setBusServoPulse(3,180, 1000)
    Board.unloadBusServo(1)
    Board.unloadBusServo(2)
    Board.unloadBusServo(3)
    Board.unloadBusServo(4)
    Board.unloadBusServo(5)
    Board.unloadBusServo(6)
    print('全部下使能')
    i=1
    while True:
        time.sleep(1)
        pulse1 = Board.getBusServoPulse(1)  
        pulse2 = Board.getBusServoPulse(2)  
        pulse3 = Board.getBusServoPulse(3)  
        pulse4 = Board.getBusServoPulse(4)  
        pulse5 = Board.getBusServoPulse(5)  
        pulse6 = Board.getBusServoPulse(6)  
        # 使用f-string（在Python 3.6+中可用）来格式化字符串并打印五个关节的读数  
        print(f"这是第{i}次循环")  
        i += 1  # 增加i的值 
        print(f"关节1位置为{pulse1}\n关节2位置为{pulse2}\n关节3位置为{pulse3}\n关节4位置为{pulse4}\n关节5位置为{pulse5}\n关节6位置为{pulse6}")




